<?php

Raise::load('core.RaiseObject');
Raise::load('core.geometry.RaisePoint');

/**
 * RaiseGridCell class
 * A grid cell consisting of row and column position with its value
 *
 * @author Sam-Mauris Yong / hellclanner at live dot com
 * @license http://www.opensource.org/licenses/bsd-license New BSD License
 * @package phpraise.core.structure
 * @since 1.2
 */
class RaiseGridCell extends RaiseObject {
    
    /**
     * A zero-based index of the column which this cell resides
     * @var integer
     */    
    private $column;
    
    /**
     * A zero-based index of the row which this cell resides
     * @var integer
     */
    private $row;
    
    /**
     * The value in this cell
     * @var mixed
     */
    private $value;
    
    /**
     * Create a new RaiseGridCell
     * @param integer $column Set the zero-based index of the column which this cell resides
     * @param integer $row Set the zero-based index of the row which this cell resides
     * @param mixed $value Set the value of this grid cell.
     */
    public function __construct($column, $row, $value){
        $this->column($column);
        $this->row($row);
        $this->value($value);
    }
    
    /**
     * Get or set the zero-based index of the column which this cell resides
     * @param integer $c (optional) Set the zero-based index of the column which this cell resides
     * @return integer
     */
    public function column($c = null){
        if(func_num_args() == 1){
            $this->column = $c;
        }
        return $this->column;
    }

    /**
     * Get or set the zero-based index of the row which this cell resides
     * @param integer $r (optional) Set the zero-based index of the row which this cell resides
     * @return integer
     */
    public function row($r = null){
        if(func_num_args() == 1){
            $this->row = $r;
        }
        return $this->row;
    }

    /**
     * Get or set the value in this cell
     * @param mixed $v (optional) Set the value in this cell
     * @return mixed
     */
    public function value($v = null){
        if(func_num_args() == 1){
            $this->value = $v;
        }
        return $this->value;
    }
    
}